/*-------------------------------------------------------------------------
 *
 * gp_segment_config.h
 *    a segment configuration table
 *
 * Copyright (c) 2006-2011, Greenplum Inc.
 *
 * $Id: $
 * $Change: $
 * $DateTime: $
 * $Author: $
 *-------------------------------------------------------------------------
 */
#ifndef _GP_SEGMENT_CONFIG_H_
#define _GP_SEGMENT_CONFIG_H_

#include "catalog/genbki.h"

/*
 * Defines for gp_segment_config table
 */
#define GpSegmentConfigRelationName		"gp_segment_configuration"

#define MASTER_DBID 1
#define MASTER_CONTENT_ID (-1)
#define InvalidDbid 0

/* TIDYCAT_BEGINDEF

   CREATE TABLE gp_segment_configuration
   with (camelcase=GpSegmentConfig, shared=true, oid=false, relid=5036, reltype_oid=6442, toast_oid=2900, toast_index=2901, toast_reltype=2906, content=MASTER_ONLY)
   (
   dbid              smallint   , -- up to 32767 segment databases
   content           smallint   , -- up to 32767 contents -- only 16384 usable with mirroring (see dbid)

   role              "char"     ,
   preferred_role    "char"     ,
   mode              "char"     ,
   status            "char"     ,
   port              integer    ,

   hostname          text       ,
   address           text       ,

   replication_port  integer    ,
   san_mounts        int2vector   -- one or more mount-points used by this segment.
   );

   create unique index on gp_segment_configuration(content, preferred_role) with (indexid=6106, indexname=gp_segment_config_content_preferred_role_index);
   create unique index on gp_segment_configuration(dbid) with (indexid=6107, indexname=gp_segment_config_dbid_index);

   TIDYCAT_ENDDEF
*/
/* TIDYCAT_BEGIN_CODEGEN 

   WARNING: DO NOT MODIFY THE FOLLOWING SECTION: 
   Generated by tidycat.pl version 21.
   on Wed Nov 24 14:21:13 2010
*/


/*
 TidyCat Comments for gp_segment_configuration:
  Table is shared, so catalog.c:IsSharedRelation is updated.
  Table does not have an Oid column.
  Table has static type (see pg_types.h).
  Table has TOASTable columns, and TOAST table has static type.
  Table contents are only maintained on MASTER.

*/

/* ----------------
 *		gp_segment_configuration definition.  cpp turns this into
 *		typedef struct FormData_gp_segment_configuration
 * ----------------
 */
#define GpSegmentConfigRelationId	5036

CATALOG(gp_segment_configuration,5036) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{
	int2		dbid;				/* up to 32767 segment databases */
	int2		content;			/* up to 32767 contents -- only 16384 usable with mirroring (see dbid) */

	char		role;				
	char		preferred_role;		
	char		mode;				
	char		status;				
	int4		port;				

	text		hostname;			
	text		address;			

	int4		replication_port;	
	int2vector	san_mounts;			/* one or more mount-points used by this segment. */
} FormData_gp_segment_configuration;


/* ----------------
 *		Form_gp_segment_configuration corresponds to a pointer to a tuple with
 *		the format of gp_segment_configuration relation.
 * ----------------
 */
typedef FormData_gp_segment_configuration *Form_gp_segment_configuration;


/* ----------------
 *		compiler constants for gp_segment_configuration
 * ----------------
 */
#define Natts_gp_segment_configuration					11
#define Anum_gp_segment_configuration_dbid				1
#define Anum_gp_segment_configuration_content			2
#define Anum_gp_segment_configuration_role				3
#define Anum_gp_segment_configuration_preferred_role	4
#define Anum_gp_segment_configuration_mode				5
#define Anum_gp_segment_configuration_status			6
#define Anum_gp_segment_configuration_port				7
#define Anum_gp_segment_configuration_hostname			8
#define Anum_gp_segment_configuration_address			9
#define Anum_gp_segment_configuration_replication_port	10
#define Anum_gp_segment_configuration_san_mounts		11


/* TIDYCAT_END_CODEGEN */

#endif /*_GP_SEGMENT_CONFIG_H_*/
